.toggleSwitchWrapper {
  display: grid;
  grid-template-areas: 'check text';
  grid-template-columns: min-content 1fr;
  align-items: center;
  justify-items: flex-start;
  text-align: start;
  cursor: pointer;
  white-space: pre-line;
}

.hiddenCheckbox {
  display: none;
}

/* add fake checkbox */
.toggleSwitchWrapper:before {
  content: '';
  display: inline-flex;
  justify-content: center;
  margin-inline-start: 13px;
  margin-inline-end: 0.5rem;
  width: 20px;
  height: 20px;
  transition: 350ms;
  border: 3px solid var(--accent);
  border-radius: var(--space-3xs);
  grid-area: check;
  color: var(--background);
  font-size: var(--text-xl);
  line-height: var(--space-lg-fixed);
  font-weight: var(--extrabold);
  font-family: Arial, Helvetica, sans-serif;
}

.toggleSwitchWrapper span {
  align-self: center;
  justify-self: flex-start;
  transition: 350ms;
  color: var(--text-default);
}

.toggleSwitchWrapper:hover span {
  transition: 350ms;
  color: var(--background);
}

.hiddenCheckbox:checked + .toggleSwitchWrapper:before {
  content: '\2713';
  background: var(--accent);
}

.hiddenCheckbox:checked + .toggleSwitchWrapper span {
  font-weight: var(--bold);
  color: var(--accent);
}

.hiddenCheckbox[disabled] + .toggleSwitchWrapper {
  color: var(--icon-disabled);
  cursor: not-allowed;
}

.hiddenCheckbox[disabled] + .toggleSwitchWrapper:before {
  border-color: var(--icon-disabled);
}

/* fade in and out animation */
.toggleSwitchWrapper.fading {
  animation: fading infinite 1.5s;
}

@keyframes fading {
  0% {
    opacity: 0.5;
  }
  50% {
    opacity: 1;
  }
  100% {
    opacity: 0.5;
  }
}
